﻿using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;

namespace Lib.Approval
{
    public partial class DeleteConfirmation : ChildWindow
    {
        public ApprovalViewModel VM
        {
            get { return this.DataContext as ApprovalViewModel; }
        }
        
        public DeleteConfirmation()
        {
            InitializeComponent();
        }

        private void OKButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = true;
        }

        private void CancelButton_Click(object sender, RoutedEventArgs e)
        {
            this.DialogResult = false;
        }

        private void PasswordBox_KeyDown(object sender, System.Windows.Input.KeyEventArgs e)
        {
            if (e.Key == Key.Enter)
            {
                VM.User.Password = (sender as PasswordBox).Password;
                VM.validateLogin(null);
            }
        }
    }
}

